﻿using BCEntity.Common.Banner;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace BCData.Common.Banner
{
    /// <summary>
    /// Banner数据处理接口
    /// </summary>
    public interface IBannerData
    {
        /// <summary>
        /// 检查Banner是否存在
        /// </summary>
        /// <param name="bannerId">BannerId</param>
        /// <returns></returns>
        bool CheckBannerExists(long bannerId);
        /// <summary>
        /// 检查Banner是否存在
        /// </summary>
        /// <param name="bannerName">Banner名称</param>
        /// <returns></returns>
        bool CheckBannerExists(string bannerName);
        /// <summary>
        /// 检查Banner分类编码正在使用中
        /// </summary>
        /// <param name="bannerTagcode">Banner分类编码</param>
        /// <returns></returns>
        bool CheckBannerTagcodeInUse(string bannerTagcode);
        /// <summary>
        /// 添加Banner信息
        /// </summary>
        /// <param name="bannerRequestDto">Banner请求对象</param>
        /// <returns></returns>
        BannerEntity Add(BannerEntity bannerEntity);
        /// <summary>
        /// 修改Banner信息
        /// </summary>
        /// <param name="bannerRequestDto">Banner请求对象</param>
        /// <returns></returns>
        BannerEntity Update(BannerEntity bannerEntity);
        /// <summary>
        /// 删除Banner信息
        /// </summary>
        /// <param name="bannerId"></param>
        void Delete(long bannerId);
        /// <summary>
        /// 获取Banner列表
        /// </summary>
        /// <param name="bannerTagcode">Banner分类编码</param>
        /// <returns></returns>
        IEnumerable<BannerEntity> Get(string bannerTagcode);
        /// 获取Banner标记信息（分页）
        /// </summary>
        /// <param name="name">Banner名称</param>
        /// <param name="bannerTagcode">Banner分类编码</param>
        /// <param name="dataCount">数据总数</param>
        /// <param name="ascending">排序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <returns></returns>
        IEnumerable<BannerEntity> GetPageableList(string name, string bannerTagcode, out int dataCount, bool? ascending, int pageIndex = 1, int pageSize = 20);
        /// <summary>
        /// 获取Banner信息
        /// </summary>
        /// <param name="bannerId">BannerId</param>
        /// <returns></returns>
        BannerEntity GetEntity(long bannerId);
        /// <summary>
		/// 是否存在该记录
		/// </summary>
		/// <param name="bannerId">BannerId</param>
		Task<bool> Exists(long bannerId);
        /// <summary>
		/// 启用Banner
		/// </summary>
		/// <param name="bannerId">BannerId</param>
		Task<bool> Enabled(long bannerId);
        /// <summary>
        /// 禁用Banner
        /// </summary>
        /// <param name="bannerId">BannerId</param>
        Task<bool> Disabled(long bannerId);
    }
}
